-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add support for delegating write to split target #136241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for delegating write to split target #136241
Conversation
…itRequestOnSourceTwoPass Refresh
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass merged
…itRequestOnSourceTwoPass Refresh
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass pull
…itRequestOnSourceTwoPass Refresh
…itRequestOnSourceTwoPass Refresh
…itRequestOnSourceTwoPass Refresh
…itRequestOnSourceTwoPass Refresh
…com:ankikuma/elasticsearch into 09162025/ReshardSplitRequestOnSourceTwoPass Pull
…itRequestOnSourceTwoPass Refresh
…com:ankikuma/elasticsearch into ankikuma-09162025/ReshardSplitRequestOnSourceTwoPass
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
…hardSplitRequestOnSourceTwoPass
…hardSplitRequestOnSourceTwoPass
...r/src/main/java/org/elasticsearch/action/support/replication/TransportReplicationAction.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/bulk/ShardBulkSplitHelper.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/action/bulk/ShardBulkSplitHelper.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/routing/IndexRouting.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/routing/IndexRouting.java
Outdated
Show resolved
Hide resolved
LGTM |
…hardSplitRequestOnSourceTwoPass
…hardSplitRequestOnSourceTwoPass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I had a few questions/suggestions but nothing major. We probably want some more end-to-end ITs when this lands.
server/src/main/java/org/elasticsearch/action/bulk/ShardBulkSplitHelper.java
Show resolved
Hide resolved
} | ||
} | ||
BulkShardResponse bulkShardResponse = new BulkShardResponse(originalRequest.shardId(), bulkItemResponses); | ||
// TODO: Decide how to handle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you looked at consumers of this? If so could you leave a breadcrumb to your investigation? If not, we should ticket that and link the ticket here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server/src/main/java/org/elasticsearch/action/support/replication/ReplicationSplitHelper.java
Show resolved
Hide resolved
new ShardId(index, newShardId), | ||
shardNum -> new ArrayList<>() | ||
); | ||
shardRequests.add(new BulkItemRequest(bulkItemRequest.id(), bulkItemRequest.request())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we assert anything about the shard id in bulkItemRequest.request()
? From skimming code I think it's probably null (thin serialization) but I don't know if it always is, or how it would be used if it's not null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server/src/main/java/org/elasticsearch/cluster/routing/IndexRouting.java
Show resolved
Hide resolved
} | ||
return indexShard(indexRequest); | ||
} else if (addIdWithRoutingHash) { | ||
// TODO: is this correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're probably going to have to generate test cases for tsdb/logsdb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.../src/test/java/org/elasticsearch/action/support/replication/ReplicationSplitHelperTests.java
Outdated
Show resolved
Hide resolved
This commit adds the logic to delegate bulk shard requests to the split target when a primary receives a request from a stale coordinator.
This commit adds the logic to delegate bulk shard requests to the split
target when a primary receives a request from a stale coordinator.